﻿<Page xmlns:my1="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"  x:Class="IntroductionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
    Title="Introduction" AllowDrop="True">
    <FlowDocumentPageViewer Style="{StaticResource FlowDocumentPageViewerStyle}">
        <FlowDocument>
            <Paragraph Style="{StaticResource ParagraphPageTitle}" TextAlignment="Center">
                SQL Server 2008 Technology Demonstration Application
            </Paragraph>
            <Paragraph>
                This application demonstrates the following new features in SQL Server 2008:
            </Paragraph>
            <List>
                <ListItem>
                    <Paragraph>GEOGRAPHY, GEOMETRY, and DATETIMEOFFSET types</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>spatial operators on the GEOGRAPHY and GEOMETRY types</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>FILESTREAM and SPARSE column attributes</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>FULL TEXT indexing and searches [future]</Paragraph>
                </ListItem>
            </List>
            <Paragraph>
                The application utilizes these features while managing a database of
		            digital photos. Image files are loaded into the database by dropping them
                onto the application. Dynamic albums can be defined which select rows from the
                database for display.
                <Figure Width="100" BorderThickness="1" BorderBrush="White" 
                        HorizontalAnchor="ColumnRight" 
                        VerticalOffset="50">
                    <BlockUIContainer>
                        <Border Padding="0">
                            <my1:Image Name="Image0">
                                <my1:Image.Source>
                                    <BitmapImage UriSource="Resources\Camera.png" />
                                </my1:Image.Source>
                            </my1:Image>
                        </Border>
                    </BlockUIContainer>
                    <Paragraph FontSize="10">
                        <LineBreak/>
                        A random photo from the catalog could go here.
                    </Paragraph>
                </Figure>
            </Paragraph>
            <Paragraph>
                The GEOGRAPHY type is used to store the locations of photos
                that have a GPS location in their metadata. Locations are stored as
                points in the database. These points
	            are used to place the photos on maps, and are also used to define albums using 
                spatial queries which 
                exercise some of the new spatial operators in SQL Server. 
            </Paragraph>
            <Paragraph>
                Each photo's
                location is also used to determine the timezone where the photo was taken.
                If the timezone is known, the date can be stored using the new DATETIMEOFFSET type.
                Metadata from the image's EXIF GPS section is stored using
                SPARSE columns, while the photos themselves are stored in
                VARBINARY(MAX) FILESTREAM columns. After initially loading the photos
                into FILESTREAMs, the application retrieves all photos from the
                FILESTREAMs for subsequent display.
            </Paragraph>
            <Paragraph>
                The application exercises the new SQL Server 2008 features by
            </Paragraph>

            <List>
                <ListItem>
                    <Paragraph>creating a set of tables to contain a photo catalog in SQL Server</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>loading the catalog with JPG image metadata stored SPARSE columns</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>storing the images in VARBINARY(MAX) FILESTREAM columns</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>creating a GEOGRAPHY point for each image using GPS metadata contained in each image</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>loading time zone polygons into GEOMETRY columns used to determine the time zone for each photo</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>storing the date/time of the image in a time zone-aware DATETIMEOFFSET if the time zone can be determined from GPS metadata and time zone polygon data</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>querying the catalog for images using criteria entered by the user in the form of SQL queries that can be named and persisted in the catalog as dynamic albums</Paragraph>
                </ListItem>
            </List>

            <Paragraph>
                When rows are returned after each query, the application
            </Paragraph>

            <List>
                <ListItem>
                    <Paragraph>displays image thumbnails retrieved from each row</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>displays a point on a map for each row that has a location</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>displays the metadata for each row</Paragraph>
                </ListItem>
            </List>

            <Paragraph>
                When a specific image is selected, the application
            </Paragraph>

            <List>
                <ListItem>
                    <Paragraph>displays the full image</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>displays the full row from the table</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>zooms the map to the image</Paragraph>
                </ListItem>
            </List>
            <Paragraph>

                The application provides three views of the data. These views in turn
		have a summary display mode and a detailed display mode. The active
		window shows its detailed view while the other two windows show
		their summary views. These views are described in the following table:

            </Paragraph>

            <Table>
                <Table.CellSpacing>10</Table.CellSpacing>
                <Table.BorderThickness>1</Table.BorderThickness>
                <Table.BorderBrush>Black</Table.BorderBrush>
                <Table.Columns>
                    <TableColumn Width="25*"/>
                    <TableColumn Width="35*"/>
                    <TableColumn Width="40*"/>
                </Table.Columns>
                <TableRowGroup>
                    <TableRow Background="LightBlue">
                        <TableCell>
                            <Paragraph>View</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>Summary Mode</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>Detail Mode</Paragraph>
                        </TableCell>
                    </TableRow>
                    <TableRow>
                        <TableCell>
                            <Paragraph>Image</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>the image</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>thumbnails</Paragraph>
                        </TableCell>
                    </TableRow>
                    <TableRow>
                        <TableCell>
                            <Paragraph>Map</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>overview showing the photos in the album</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>map with full user pan/zoom controls</Paragraph>
                        </TableCell>
                    </TableRow>
                    <TableRow>
                        <TableCell>
                            <Paragraph>Database</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>a data grid</Paragraph>
                        </TableCell>
                        <TableCell>
                            <Paragraph>a friendly portrayal of the data</Paragraph>
                        </TableCell>
                    </TableRow>
                </TableRowGroup>
            </Table>

            <Paragraph>

                The user can choose the database to use. If the required tables
		are not in the database, the application can create them. The
		application remembers the connection specification and reconnects when
		the application is started again at a later time.  A Statistics
		function analyzes the frequency of null and non-null values in the
		SPARSE columns and show the database savings (or cost) from using
		SPARSE [future].

            </Paragraph>
        </FlowDocument>
    </FlowDocumentPageViewer>
</Page>
